home *** CD-ROM | disk | FTP | other *** search
- #include "srgplocal.h"
-
- void SRGP_putImage(top_x, top_y, width, height, data)
- int top_x, top_y, width, height;
- char *data;
- {
- GrContext GC;
-
- (void) GrCreateContext(width, height, data, &GC);
- GrBitBlt((GrContext *) 0, top_x, top_y, &GC, 0, 0,
- width, height, GrWRITE);
- GrDestroyContext(&GC);
- }
-
- int SRGP_loadGreyColorTable(first, last)
- int first, last;
- {
- static int first_time = 1;
- int i, value;
-
- if (first == 0 && last == 0)
- return 1;
-
- if (first < 16 || first >= last || last > 255)
- return 0;
-
- if (first_time)
- {
- first_time = 0;
- if (GrNumColors() != 256)
- return 0;
- for (i = first; i <= last; i++)
- {
- value = (int) ((float) (i - first) / (float) (last - first) * 255.99);
- GrSetColor(i, value, value, value);
- }
- }
- return 1;
- }
-